package com.sun.designpatternsdemo.mediator

import android.os.Bundle
import com.sun.designpatternsdemo.R
import com.sun.designpatternsdemo.base.BaseActivity
import com.sun.designpatternsdemo.databinding.ActivityMediatorBinding

class MediatorActivity : BaseActivity<ActivityMediatorBinding>() {

    override fun layoutId(): Int =R.layout.activity_mediator

    override fun initView(savedInstanceState: Bundle?) {
        title = "中介者模式"
        mDataBind.apply {
            btUser1.setOnClickListener {
                val jingbing = User("jingbin")
                jingbing.sendMessage("Hi~youlookwhat!")
            }
            btUser2.setOnClickListener {
                val jingbin  =User("youlookwhat")
                jingbin.sendMessage("Hi~jingbin!")
            }
        }
    }
}